package com.order.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDateTime;

/**
 * 订单进度实体类
 */
public class OrderProgress {
    
    private Long id;
    private Long orderId;
    private Long userId;
    private String content;
    private Integer progressType; // 1-接单，2-进度更新，3-完成，4-验收，5-取消
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    // 关联字段
    private String userName;

    public OrderProgress() {}

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getProgressType() {
        return progressType;
    }

    public void setProgressType(Integer progressType) {
        this.progressType = progressType;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     * 获取进度类型名称
     */
    public String getProgressTypeName() {
        switch (progressType) {
            case 1: return "接单";
            case 2: return "进度更新";
            case 3: return "完成";
            case 4: return "验收";
            case 5: return "取消";
            default: return "未知";
        }
    }
}